public class test {
    public static void main(String[] args) {
        MyArray<Integer> myArray = new MyArray<>();//
        myArray.setVal(0, 10);
        myArray.setVal(1, 12);
        Integer ret =  myArray.getPos(1);
        System.out.println(ret);
    }

    public static void main2(String[] args) {
        MyArray myArray = new MyArray();
        myArray.setVal(0, 10);
        myArray.setVal(1, "hello");//字符串也可以存放
        //String ret = (String)myArray.getPos(1);
        int ret = (int) myArray.getPos(0);//这里必须要强制类型转换，否则不兼容
        System.out.println(ret);
    }

    public static void main1(String[] args) {
        /*
        Integer a = 127;
        Integer b = 127;
        Integer c = 128;
        Integer d = 128;
        System.out.println(a == b);
        System.out.println(c == d);
        //原因，value在一定范围时，Integer是在数组中拿值，超过该范围时Integer内部会返回一个新的对象，所以不一样
        */
    }
}
